import 'package:exams_app/gen_a/A.dart';
import 'package:exams_app/widget/hexcolor.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:package_info/package_info.dart';


class AboutPage extends StatefulWidget {
  const AboutPage({Key key}) : super(key: key);

  @override
  _AboutPageState createState() => _AboutPageState();
}

class _AboutPageState extends State<AboutPage> {


  var _version = '';

  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    initVersion();
  }

  void initVersion()async{
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    String version = packageInfo.version;//版本号
    _version = version;
    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {


    return Scaffold(
      appBar: AppBar(
        title: Text('关于',),
        centerTitle: true,
      ),
      body: Column(
        // mainAxisAlignment:MainAxisAlignment.center,
        children: [
          Expanded(child: Center(
            child: Container(
              margin: EdgeInsets.only(top: 100),
              child: Column(
                children: [
                  Image.asset(A.assets_102400,width: 50,height: 50,),
                  Container(
                    margin: EdgeInsets.only(top: 10),
                    child: Text('“档”建站台',style: TextStyle(fontSize: 14,fontWeight: FontWeight.w500),),
                  )
                ],
              ),
            ),
          ),),
          Expanded(child: Container(
            padding: EdgeInsets.only(bottom: 55),
            alignment: Alignment.bottomCenter,
            // color: Colors.red,
            child: Text('当前版本号:v${_version}',style: TextStyle(color: HexColor('#666666'),fontSize: 14),),
          ))
        ],
      ),
    );
  }
}
